package com.example.common.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
    public static final String DEFAULT_PATTERN = "yyyy-MM-dd HH:mm:ss";
    
    public static String format(Date date) {
        return new SimpleDateFormat(DEFAULT_PATTERN).format(date);
    }
    
    public static String format(Date date, String pattern) {
        return new SimpleDateFormat(pattern).format(date);
    }
}